﻿using System.Collections.Concurrent;

namespace Fvs_Service.Log
{
    /// <summary>
    /// 日志队列
    /// </summary>
    public class QueueLogger:Logger
    {
        /// <summary>
        /// 日志队列
        /// </summary>
        public ConcurrentDictionary<int,string> Queue { get; } = new ConcurrentDictionary<int, string>();

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="level">日志级别</param>
        public QueueLogger(LogLevel level) 
            : base(level, level)
        {

        }

        protected override void LogCore(int eventId,string log)
        {
            Queue[eventId] = log;
        }
    }
}
